<!DOCTYPE html>
<html>

<head>
    <title>存储光交业务管理系统V1</title>
    <meta content="text/html" charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    {#    <meta name="viewport" content="width=device-width, initial-scale=1">#}
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- Fonts -->
    <link href='http://fonts.googleapis.com/css?family=Roboto+Condensed:300,400' rel='stylesheet' type='text/css'>
    <link href='http://fonts.googleapis.com/css?family=Lato:300,400,700,900' rel='stylesheet' type='text/css'>
    <!-- CSS Libs -->
    <link rel="stylesheet" type="text/css" href="/static/css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="/static/css/font-awesome.min.css">
    <link rel="stylesheet" type="text/css" href="/static/css/animate.min.css">
    <link rel="stylesheet" type="text/css" href="/static/css/bootstrap-switch.min.css">
    {#    <link rel="stylesheet" type="text/css" href="/static/css/checkbox3.min.css">#}
    {#    <link rel="stylesheet" type="text/css" href="/static/css/jquery.dataTables.min.css">#}
    {#    <link rel="stylesheet" type="text/css" href="/static/css/dataTables.bootstrap.css">#}
    {#    <link rel="stylesheet" type="text/css" href="/static/css/select2.min.css">#}
    <!-- CSS App -->
    {#    <link rel="stylesheet" type="text/css" href="/static/css/style.css">#}
    <link rel="stylesheet" type="text/css" href="/static/css/themes/flat-blue.css">

</head>

<body class="flat-blue login-page">
<div class="container">
    <div class="login-box">
        <div>
            <div class="login-form row">
                <div class="col-sm-12 text-center login-header " style="margin-top: 10%">
                    <i class="login-logo fa fa-connectdevelop fa-5x"></i>
                    <h3 class="text-primary" >存储光交业务管理系统V1</h3>
                </div>
                <div class="col-sm-12">
                    <div class="login-body">
                        <div class="progress hidden" id="login-progress">
                            <div class="progress-bar progress-bar-success progress-bar-striped active" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%">
                                登入
                            </div>
                        </div>
                        <div class="col-sm-offset-4 col-sm-4">
                            <div>
                                {#                            <form action ="{% url "auto_login" %}" method="GET">#}
                                <div class="form-group">
                                    <!-- <label for="inputEmail3" class="col-sm-2 control-label">Email</label> -->
                                    <div class="col-sm-12">
                                        <input type="text" name="user" class="form-control user" placeholder="请输入用户名：">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <!-- <label for="inputPassword3" class="col-sm-2 control-label">Password</label> -->
                                    <div class="col-sm-12">
                                        <input type="password" name="password" class="form-control password"placeholder="请输入密码：">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <div class="col-sm-offset-2 col-sm-10">
                                        <div class="checkbox">
                                            <label>
                                                <input type="checkbox"> <P style="margin-top: 3px">记住我</P>
                                            </label>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <div class="col-sm-offset-4 col-sm-12">
                                        <a  class=" btn btn-success login">登        入</a>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="login-footer">
                        <!-- <span class="text-right"><a href="#" class="color-white">Forgot password?</a></span> -->
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- Javascript Libs -->
<script type="text/javascript" src="/static/js/jquery.min.js"></script>
<script type="text/javascript" src="/static/js/bootstrap.min.js"></script>
<script type="text/javascript" src="/static/js/Chart.min.js"></script>
<script type="text/javascript" src="/static/js/bootstrap-switch.min.js"></script>

<script type="text/javascript" src="/static/js/jquery.matchHeight-min.js"></script>
<script type="text/javascript" src="/static/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="/static/js/dataTables.bootstrap.min.js"></script>
<script type="text/javascript" src="/static/js/select2.full.min.js"></script>
<script type="text/javascript" src="/static/js/ace/ace.js"></script>
<script type="text/javascript" src="/static/js/ace/mode-html.js"></script>
<script type="text/javascript" src="/static/js/ace/theme-github.js"></script>
<!-- Javascript -->

<script type="text/javascript" src="/static/js/app.js"></script>
</body>
<script>
    $(".login").click(function () {
        var user = $(".user").val()
        var password = $(".password").val()
        $.ajax({
            url: "{% url "login_ajax" %}",
            type: 'POST',
            data:{"user":user,"password":password},
            success: function(data){
                var obj = JSON.parse(data);
                if(obj.status){
                    alert("登入成功")
                    window.location.reload()
                }else{
                    alert(obj.error)
                    $(".user").val("")
                    $(".password").val("")
                };
            }
        });
    });
</script>
</html>
